import { get, post } from './api-caller';

const searchByPrefix = (domain: number, prefix: string, size: number = 5) =>
  get<SimpleTag[]>({ path: '/api/tags/search', searchParams: { domain, prefix, size } });

const create = (domain: number, name: string) => post<SimpleTag>({ path: '/api/tags', body: { name, domain } });

const tagsApis = { searchByPrefix, create };

export default tagsApis;
